
$(document).ready(function() {

  function commafy(val) {
    var pos;
    val=val.split(",").join("");   // remove existing commas if present.
    var dot=val.indexOf(".");      // locate decmal
    if(dot<0)dot=val.length;       // use end if no decimal
    var r="";
    for(pos=dot-3;pos>=1;pos-=3)   // put commas in
      r="."+val.substr(pos,3)+r;
      r=val.substring(0,pos+3)+r;    // put start of string on
      return r;
  }
  
  function calc() {
    var start = 7000000000;
    var persecond = 2.633333333333333333333;
    var secsince = new Date(2011, 9, 31, 12, 0, 0);
    var akttime = new Date();
    var diff = new Number(akttime - secsince)/1000;
    var pop = diff * persecond + start;
    str = new String(pop);
    document.getElementById("count").innerHTML=commafy(str);
  }
  
  setInterval('self.calc()',1000);

});
